package com.nervenets.web.hibernate.domain;

import com.nervenets.web.enumeration.Gender;
import com.nervenets.web.hibernate.DomainObject;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;

/**
 * 地址
 */
@EqualsAndHashCode(callSuper = true)
@Entity
@Table(name = "addresses", indexes = {
        @Index(name = "index_of_latlng", columnList = "longitude,latitude")
})
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Address extends DomainObject {
    private long userId;
    private String name;
    private Gender gender;
    private String mobile;
    private int areaId;
    private String detail;
    private double longitude = 0;
    private double latitude = 0;
    private boolean def = false;
}
